﻿<UserControl 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"  
    x:Class="TM.QWeibo.Client.UserControls.MentionUser"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    <UserControl.Resources>
        <Storyboard x:Name="PopupOffStoryboard">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.VerticalOffset)" Storyboard.TargetName="popUserList">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1500"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PopupOnStoryboard">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.VerticalOffset)" Storyboard.TargetName="popUserList">
                <EasingDoubleKeyFrame KeyTime="0" Value="1500"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <DataTemplate x:Name="UserListItemTemplate">
            <StackPanel Orientation="Horizontal" Margin="0,0,0,12" Background="Transparent">
                <Image x:Name="imgAvator" Source="{Binding Head, Converter={StaticResource HeadUrlConverter},ConverterParameter='50'}" Stretch="Fill" Width="45" Height="45" Margin="0,0,6,0"/>
                <TextBlock Text="{Binding NickName}" Style="{StaticResource MentionUserNickNameStyle}" />
                <TextBlock Text="{Binding Name,StringFormat='(\{0\})'}" Style="{StaticResource MentionUserNameStyle}" />
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>

    <Popup x:Name="popUserList" IsOpen="False" HorizontalOffset="0" VerticalOffset="1500">
        <Grid x:Name="UserListGrid" Style="{StaticResource MentionUserLayoutGrid}">
            <StackPanel Orientation="Vertical">
                <toolkit:PerformanceProgressBar x:Name="processbar" IsIndeterminate="False" Width="400" HorizontalContentAlignment="Center"   Style="{StaticResource PerformanceProgressBarStyle}" />
                <TextBlock Text="@ta" Style="{StaticResource MentionUserPageTitleStyle}"/>
                <StackPanel Orientation="Horizontal">
                    <TextBox x:Name="txtKeyword" Style="{StaticResource MentionUserTextboxStyle}" GotFocus="txtKeyword_GotFocus" LostFocus="txtKeyword_LostFocus" KeyUp="txtKeyword_KeyUp" TextChanged="txtKeyword_TextChanged"/>
                    <Button x:Name="btnSearch" Style="{StaticResource MentionUserButtonStyle}" Content="查找" Click="btnSearch_Click" />
                </StackPanel>
                <ListBox x:Name="UserListBox" Margin="12,0,0,80" Background="Transparent" Tap="UserListBox_Tap" ItemTemplate="{StaticResource UserListItemTemplate}" >
                </ListBox>
            </StackPanel>
        </Grid>
    </Popup>
</UserControl>
